package com.bao.work;

public class Abstract03 {
    public static void main(String[] args) {
        Person[] ps=new Person[3];
        ps[0]=new Chinese();
        ps[1]=new American();
        ps[2]=new Indian();
        for (Person p : ps) {
            p.eat();
        }
    }
}
class Chinese extends Person{

    @Override
    public void pee() {

    }

    @Override
    public void eat() {
        System.out.println("用筷子吃");
    }
}
class American extends Person{

    @Override
    public void pee() {

    }

    @Override
    public void eat() {
        System.out.println("用刀叉吃");
    }
}

class Indian extends Person {

    @Override
    public void pee() {

    }

    @Override
    public void eat() {
        System.out.println("用手抓饭");
    }
}
